#include "AVLTree.h"
#include <vector>
void AVLTreeTest1()
{
    AVLTree<int> av;
    //int a[] = { 16, 3, 7, 11, 9, 26, 18, 14, 15 };
	//特殊带有双旋场景测试用例
	int a[] = { 4, 2, 6, 1, 3, 5, 15, 7, 16, 14 };
    for(const auto& e : a)
    {
        av.Insert(e);
    }
    cout << av.IsAVLTree() << endl;
}
void AVLTreeTest2()
{
    const size_t N = 1000000;
    vector<int> v;
    AVLTree<int> av;
    srand(time(0));
    v.reserve(N);
    for(size_t i = 0;i < N;i++)
    {
        v.push_back(rand() + i);
    }
    int begin1 = clock();
    for(const auto& e : v)
    {
        av.Insert(e);
    }
    int end1 = clock();
    cout << "Insert:" << end1 - begin1 << endl;
    cout << av.IsAVLTree() << endl;
}
int main()
{
    AVLTreeTest2();
    return 0;
}